﻿using CuaHangLego.DataAccess;
using CuaHangLego.Model;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CuaHangLego.Bussiness.Parser
{
    public class SanPhamKhoParser
    {
        public static SanPhamKho Parse(SqlDataReader sdata)
        {
            SanPhamKho sp = new SanPhamKho();
            sp = new SanPhamKho(SanPhamParser.Parse(sdata));
            sp.IsVisible = int.Parse(sdata["IsVisible"].ToString()) > 0;
            sp.SoLuong = int.Parse(sdata["SoLuong"].ToString());
            sp.GiaMua = int.Parse(sdata["GiaMua"].ToString());
            return sp;
        }
    }
}
